#ifndef DBSTORAGE_PROJECT_DBSTORAGE
#define DBSTORAGE_PROJECT_DBSTORAGE

#include "DbStorage/DbStorageBase.hpp"
#include "Storage/ProjectStorage.hpp"

namespace DbStorage
{

/// @ingroup DbStorage
/// @brief It implements the database storage for projects.
///
/// It knows how to load a project. It uses other entity storages provided by the factory for loading the dependent 
///	case entities.
class DBSTORAGE_API ProjectDbStorage: public Storage::ProjectStorage, public DbStorageBase
{
public:
	/// @brief It initializes the storage.
	/// @param factory the storage factory providing access to the storages of dependent case entities.
	/// @param pConnection the database connection to be used for database operations.
	ProjectDbStorage( Storage::StorageFactory& factory, CaseDB::Connection* pConnection);

	/// @brief It loads the project.
	/// @param projectID the stored identifier of the project to be loaded.
	/// @return the loaded project.
	/// @throw DatabaseError in case of load failures.
	virtual Model::Project* loadProject( const boost::any& projectID);
};
	
} // namespace DbStorage

#endif // DBSTORAGE_PROJECT_DBSTORAGE